package com.lungle.warmdiary.app.view.guideview;

import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.lungle.warmdiary.R;


public class SimpleComponent implements Component {

    private Handler handler;

    public SimpleComponent(Handler handler) {
        this.handler = handler;
    }

    @Override
    public View getView(LayoutInflater inflater) {

        RelativeLayout ll = (RelativeLayout) inflater.inflate(R.layout.layer_guide, null);
        ImageView guide_close = (ImageView) ll.findViewById(R.id.guide_close);
        guide_close.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Message msg= new Message();
                msg.what=1;
                handler.sendMessage(msg);
            }
        });

        return ll;

    }

    @Override
    public int getAnchor() {
        return Component.ANCHOR_BOTTOM;
    }

    @Override
    public int getFitPosition() {
        return Component.FIT_END;
    }

    @Override
    public int getXOffset() {
        return 0;
    }

    @Override
    public int getYOffset() {
        return 10;
    }

}
